{include file="public/header296"}
<div class="layui-form" style="padding: 10px 0 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">权限范围</label>
    <div class="layui-input-block">
      <div id="test-tree-demo1"></div>
    </div>
  </div>
  <div class="layui-form-item layui-hide">
    <input type="hidden" id="id" value="{$role_id}" />
  </div>
</div>
<script>
layui.use(['tree', 'util', 'form'], function(){
  var $ = layui.$
          ,tree = layui.tree
          ,layer = layui.layer;
  let role_id = $("#id").val();
  $.ajax({
    url: "{:url('admin/getUserMenuList')}",
    type: "post",
    dataType: 'json',
    data: {role_id:role_id},
    async: false,
    success: function (res) {
      data = res.data;
    },
  });
  tree.render({
    elem: '#test-tree-demo1'
    , data: data
    , id: 'Lay-app-tree-nodes-edit'
    , showCheckbox: true
    , isJump: true
    , click: function(obj){
      return;
    }
  });
})
</script>
{include file="public/footer" /}